package cn.liuhuan1.mongoDb;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.web.client.RestTemplate;

/**
 * @Auther: liuhuan
 * @Date: 2021/1/20 - 01 - 20 - 14:47
 * @Description:
 * @version: 1.0
 */
@SpringBootApplication
@EnableEurekaClient //（这个只能作为 eureka 为注册中心时 使用） 和  EnableDiscoveryClient dubbo（这个则都可以） 区别
@EnableDiscoveryClient
@ComponentScans(@ComponentScan({"cn.liuhuan1.*"}))
public class SpringFastDfsStart {

    public static void main(String[] args) {
        SpringApplication.run(SpringFastDfsStart.class,args);
    }

    @Bean
    @LoadBalanced
    RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
